//
//  BQMenuTableViewCell.h
//  BQTableViewCellDemo
//
//  Created by Zhiqiang Bao on 15-3-16.
//  Copyright (c) 2015年 Zhiqiang Bao. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef enum _BQMenuStatus {
    BQMenuStatusHide,
    BQMenuStatusMoving,
    BQMenuStatusShow
} BQMenuStatus;

typedef enum _BQMenuPriority {
    BQMenuPriorityBelowContent,
    BQMenuPriorityOverContent
} BQMenuPriority;

@class BQMenuTableViewCell;

@protocol BQMenuTableViewCellDataSource <NSObject>

@optional

- (NSUInteger)leftMenuViewCountOfCell:(BQMenuTableViewCell *)cell;
- (UIView *)leftMenuViewAtIndex:(NSUInteger)index ofCell:(BQMenuTableViewCell *)cell;

- (NSUInteger)rightMenuViewCountOfCell:(BQMenuTableViewCell *)cell;
- (UIView *)rightMenuViewAtIndex:(NSUInteger)index ofCell:(BQMenuTableViewCell *)cell;

@end

@protocol BQMenuTableViewCellDelegate <NSObject>

@optional

- (CGFloat)leftMenuViewWidthAtIndex:(NSUInteger)index ofCell:(BQMenuTableViewCell *)cell;
- (CGFloat)rightMenuViewWidthAtIndex:(NSUInteger)index ofCell:(BQMenuTableViewCell *)cell;

- (void)leftMenuView:(BQMenuTableViewCell *)cell didSelectAtIndex:(NSUInteger)index;
- (void)rightMenuView:(BQMenuTableViewCell *)cell didSelectAtIndex:(NSUInteger)index;

- (void)rightMenuViewShowPartlyOfCell:(BQMenuTableViewCell *)cell;
- (void)rightMenuViewShowCompeletelyOfCell:(BQMenuTableViewCell *)cell;
- (void)rightMenuViewHideOfCell:(BQMenuTableViewCell *)cell;

- (void)leftMenuViewShowPartlyOfCell:(BQMenuTableViewCell *)cell;
- (void)leftMenuViewShowCompeletelyOfCell:(BQMenuTableViewCell *)cell;
- (void)leftMenuViewHideOfCell:(BQMenuTableViewCell *)cell;

@end

@interface BQMenuTableViewCell : UITableViewCell

@property (nonatomic, strong) id <BQMenuTableViewCellDataSource, BQMenuTableViewCellDelegate> delegate;

@property (nonatomic, assign) BQMenuStatus leftMenuStatus;
@property (nonatomic, assign) BQMenuStatus rightMenuStatus;

@property (nonatomic, assign) CGFloat maxContentXOffset;
@property (nonatomic, assign) CGFloat minContentXOffset;

@property (nonatomic, assign) BQMenuPriority leftMenuPriority;
@property (nonatomic, assign) BQMenuPriority rightMenuPriority;

- (void)openLeftMenu;
- (void)hideLeftMenu;

- (void)openRightMenu;
- (void)hideRightMenu;

- (void)reloadMenuData;

@end